<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div>div</div>
	</body>
	<script type="text/javascript">
		var div = document.querySelector("div");
		div.onclick = function(){
			/**
			 * class是关键字，所以用className改变类，并会覆盖原来的类名
			 * 如果想保留原来的类名，则用this.className = "firstClass change";
			 * */
			// div.className = "change";
			this.className = "change";
		}
	</script>
	
	<style type="text/css">
		.change{
			background-color: #008000;
			font-size: large;
			font-weight: 700;
			color: white;
		}
	</style>
</html>
